Package

Source Code of Sample2

import com.jcommercesql.gateway.authorizenet.AuthorizeNetCC;


public class Sample2 {

  public static void main(String[] args) {

  try {

    AuthorizeNetCC anetcc = new AuthorizeNetCC("config.prop");
    anetcc.addOptionalField("x_Address","123 Main St.")// if needed for AVS
    anetcc.addOptionalField("x_Zip","10101");      // if needed for AVS
    anetcc.setTransaction("1234123412341234","11/09","100.00","AUTH_CAPTURE");
  anetcc.addMerchantDefinedField("m_Comment", "Basic Example 2");
    anetcc.submit();

    if (anetcc.getResponseCode().equals("1")) {
  System.out.println("Your transaction was approved!");
    } else {
  System.out.println("Your transaction was declined! " + anetcc.getResponseReasonText());
    }
  } catch(Exception e) {
      System.out.println("System Error! " + e);
 
  } // end main
} // end class
TOP

Related Classes of Sample2

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.